#include "Tests.h"

#ifdef _NOISE_UNIT_TEST

void CLTest()
{
	CHECK_N( nCreateContext( CONTEXT_DEFAULT_FLAGS ) );

	int size[2] = { 640, 480 };
	CHECK_N( nSetContextInteger( IMAGE_VIEWER_SIZES, size, 2 ) );

	int flags = RENDER_MONO_TEXTURE;
	CHECK_N( nSetContextInteger( IMAGE_VIEWER_FLAGS, &flags, 1 ) );

	SourceTests();
	ProgramTest();
	ContextTest();

	RenderMemTest();
	RenderFileTest();
	RenderCLTest();
	Benchmark_CL_vs_Native();

	WARNING("CL Test is complete.");
	nDeleteContext();
}

void GLTest()
{
	// with OpenGL
	//nCreateContextFromGL(...);

	//RenderGLTest();
	//Benchmark_CL_vs_GL();
	//Benchmark_CL_GL_vs_CL_Mem();

	//nDeleteContext();
}

void DXTest()
{
	// with DirectX
	//nCreateContextFromDX(...);

	//RenderDXTest();
	
	//nDeleteContext();
}


using namespace winapi;

int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
{
	CLTest();
	GLTest();
	DXTest();
	LibNoiseInterfaceTest();
	return 0;
}

#endif	// _NOISE_UNIT_TEST